home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Agent Central Host Computer
/
Agent - Central Host Computer.iso
/
_SETUP.1
/
vjamsLoc1.sql
< prev
next >
Wrap
Text File
|
2000-05-12
|
3KB
|
60 lines
/*
This view collects together all events related to bill jams and where they happen. It includes alarm activate and clear, OCU commands, Stacker Card events, money deposited, door open and close, shift start and end.
*/
CREATE OR REPLACE VIEW VJAMSLOC1 AS
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID , 'Act' setclr,alarmact.alarm_id alarm, 0 curr_type, '01' table_code, Rpad('(01) '||descr, 200) event
from alarmact, alarmsg
where alarmact.alarm_id
in (14, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 34, 39 ) and
alarmact.alarm_id = alarmsg.alarm_id
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,'Clr' setclr, alarmclr.alarm_id alarm ,0 curr_type, '02' table_code, '(02)' ||descr event
from alarmclr, alarmsg where
alarmclr.alarm_id in (14, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 34, 39 ) and alarmclr.alarm_id = alarmsg.alarm_id
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,' ' setclr, 0 alarm, 0 curr_type,'12' table_code, '(12) ' || ocucmnd.descr event
from ocucmnd, cmdinit
where cmdinit.command_id = ocucmnd.id and
ocucmnd.id in (7, 8, 9, 10)
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,' ' setclr, 0 alarm, 0 curr_type,'15' table_code,'(15) AcceptStackerCard' event
from curacc where currency_type = 401 and currency_val = 0
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE,0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,' ' setclr, 0 alarm, FLOOR(0.01 * currency_type) curr_type, '16' table_code,
'(16) Curr Accepted ' ||
decode( FLOOR(0.01*currency_type), 2, 'Coin', 3, 'Bill', 4, 'Stacker', 'Other') ||
to_char(0.01 * currency_vaL, '999.99') event
from curacc
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID , ' ' setclr,0 alarm,0 curr_type, '24' table_code,'(24) JCDoorClose' event
from jcdoorc
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, 0 SHIFT_SEQ, 0 USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,' ' setclr, 0 alarm, 0 curr_type, '25' table_code,'(25) JCDoorOpen' event
from jcdooro
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, SHIFT_SEQ, USER_ID, ROUTE_ID,
RUN_ID, TRIP_ID, FARESET_ID ,' ' setclr,0 alarm, 0 curr_type,'33' table_code,'(33) Shift End ' event
from shftend
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, SHIFT_SEQ, USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID , ' ' setclr,0 alarm, 0 curr_type,'34' table_code,'(34) ShiftRelEnd ' event
from shftrele
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, SHIFT_SEQ, USER_ID , 0 ROUTE_ID,
0 RUN_ID, 0 TRIP_ID, 0 FARESET_ID ,' ' setclr, 0 alarm,0 curr_type, '35' table_code,'(35) ShiftRelStart' event
from shftrels
union
select DET_SEQ_NUM, FAREBOX_GLID, CONV_DATE, SHIFT_SEQ, USER_ID, ROUTE_ID,
RUN_ID, TRIP_ID, FARESET_ID ,' ' setclr, 0 alarm,0 curr_type, '36' table_code,'(36) Shift Start' event
from shftstrt;